home *** CD-ROM | disk | FTP | other *** search
/ Java Developer's Companion / Java Developer's Companion.iso / documentation / jsdk / Protecte.jav < prev    next >
Encoding:
Text File  |  1997-08-17  |  1.5 KB  |  52 lines

  1. /*
  2.  * @(#)ProtectedServlet.java    1.8 97/05/22
  3.  * 
  4.  * Copyright (c) 1996-1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.0
  20.  */
  21.  
  22. import java.io.*;
  23.  
  24. import javax.servlet.*;
  25. import javax.servlet.http.*;
  26.  
  27. /**
  28.  * This is an example of a simple Servlet
  29.  */
  30. public class ProtectedServlet extends HttpServlet { 
  31.  
  32.     public void doGet (HttpServletRequest req, HttpServletResponse res)
  33.     throws ServletException, IOException
  34.     {
  35.         res.setContentType("text/html");
  36.  
  37.         ServletOutputStream out = res.getOutputStream();
  38.         out.println("<HEAD><TITLE> ProtectedServlet Output </TITLE></HEAD><BODY>");
  39.  
  40.  
  41.     out.println("<h1> ProtectedServlet Output </h1>");
  42.     out.println("<P>This is output from ProtectedServlet.");
  43.     out.println("</BODY>");
  44.     out.close();
  45.     }
  46.  
  47.     public String getServletInfo() {
  48.         return "A simple servlet";
  49.     }
  50.  
  51. }
  52.